<?php

class Application_Plugin_Auth extends Zend_Controller_Plugin_Abstract
{
    public function preDispatch(Zend_Controller_Request_Abstract $request)
    {
        // Normal visitors are authenticated as Guest
        $auth = Zend_Auth::getInstance();
        if (!$auth->hasIdentity()) {
            $identity = new stdClass();
            $identity->role = 'guest';
            $auth->getStorage()->write($identity);
        }
    }
    
}

?>